﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace winDim
{
    public partial class Form1 : Form
    {
        /*888888888888888888888888888888888888888888888888888
         * 8  I hate comenting code, but since im putting this on codeplex i figure i should.
         * 8  Hi. Im WillWharton.com and I wrote this.
         * 8  Q?A: dubayou@gmail.com Updates: http://codeplex.com/winDim
         * 8  ===============================================
         * 8
         * 8  This is a little widget i wrote to be able to dim around a certin area on the screen. 
         * 8  Mainly for watching videos in a web browser, but has many uses.
         * 8
         *888888888888888888888888888888888888888888888888888*/

        Point a, b; //need to hold to points at any given time.
        int c;      //what click are we on?
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            button1.Text = "Move the mouse over the Top - Left corner.\nDon't Click; Use the Space Bar";  //Make this more charming if you wish
        }

        private void button1_Click(object sender, EventArgs e)
        {
            c++; //
            if (c==1){
                a = new Point(MousePosition.X, MousePosition.Y); //Top Left
                button1.Text = "Now down to the Bottom-Right corner.\n" + a.ToString();
                return;
            }

            b = new Point(MousePosition.X, MousePosition.Y);    //Bottom Right
            button1.Text = b.ToString();

            dimWindow dw = new dimWindow(); //Make it,
            dw.whiteit(a, b);               //Set it,
            dw.Show();                      //And for get it
            c = 0;                          
        }
    }
}
